﻿// ------------------------------------------------------------------------------------------------
//  <copyright file="Draft.cs" company="Iveely">
//    Copyright (c) Iveely Liu.  All rights reserved.
//  </copyright>
//  
//  <Create Time>
//    03/02/2013 21:59 
//  </Create Time>
//  
//  <contact owner>
//    liufanping@iveely.com 
//  </contact owner>
//  -----------------------------------------------------------------------------------------------

#region

using System;
using System.Collections.Generic;

#endregion

namespace IveelySE.NLP.Common.DataStructure
{
    /// <summary>
    ///   最初略的知识信息
    /// </summary>
    [Serializable]
    public class Draft
    {
        #region 属性或字段

        /// <summary>
        ///   初稿前部分内容
        /// </summary>
        public string Front { get; private set; }

        /// <summary>
        ///   初稿截断关键字
        /// </summary>
        public string Key { get; private set; }

        /// <summary>
        ///   截断关键字后面的信息
        /// </summary>
        public string Follow { get; private set; }

        /// <summary>
        ///   所在文档
        /// </summary>
        public int DocId { get; private set; }

        /// <summary>
        ///   初稿标识
        /// </summary>
        public readonly double GUID = (DateTime.UtcNow - DateTime.Parse("2012-12-31")).Ticks;

        #endregion

        #region 公有方法

        /// <summary>
        ///   增添对应问题集合
        /// </summary>
        /// <param name="docId"> 文档编号 </param>
        /// <param name="front"> 关键字切分后的前部分 </param>
        /// <param name="key"> 用于切分的关键字 </param>
        /// <param name="follow"> 关键字切分后的后半部分 </param>
        public void Add(int docId, string front, string key, string follow)
        {
            this.DocId = docId;
            this.Front = front;
            this.Key = key;
            this.Follow = follow;
        }

        /// <summary>
        ///   重载ToString()
        /// </summary>
        /// <returns> </returns>
        public override string ToString()
        {
            return this.Front + this.Key + this.Follow;
        }

        #endregion
    }
}